<template>
    <Layout style="height: 100%" class="main">
        <Header>
            <Menu mode="horizontal" theme="dark" active-name="1">
                <div class="logo-v3">
                    <img :src="logoTime" class="hd-img-responsive"/>
                </div>
                <div class="back-v3">
                  <div class="login-info">
                    <div class="user-info">
                      <span>{{personData.name}}</span>
                      <span> [{{personData.company_name}}] </span>
                    </div>
                  </div>
                  <div class="login-btn">
                    <div class="logout-btn logout-btn-item" @click="showQrCode()">
<!--                      <Icon type="ios-notifications" />-->
<!--                      消息通知-->
                      <Modal
                        v-model="modal1"
                        title="疫情消息通知"
                        @on-cancel="modal1=false">
                        <div class="qrcodeBlock">
                          <div id="qrCode" ref="qrCode"></div>
                          <div class="qrText">
                            <div>微信扫码绑定人员信息，同时关注盛事通公众号</div>
                            <div class="warningQrText">绑定后即可接收疫情防疫指挥部，推送的待审人员信息，及时处理</div>
                          </div>
                        </div>
                      </Modal>
                    </div>
                    <div class="logout-btn logout-btn-item" @click="appClick">
<!--                      <Icon type="ios-cloud-done" />-->
<!--                      移动端-->
                    </div>
                    <div class="logout-btn logout-btn-item" >
                      <Icon type="ios-call"/>
                      客服电话：024-86277288
                    </div>
                    <div class="logout-btn logout-btn-item" @click="deviceBinding()">
                      <Icon type="ios-laptop"/>
                      设备绑定
                    </div>
                    <div class="logout-btn logout-btn-item" @click="passwordInfo.show=true">
                        <Icon type="md-create"/>
                        修改密码
                    </div>
                    <div class="logout-btn logout-btn-item" @click="logout">
                        <Icon type="md-log-out"/>
                        注销
                    </div>
                  </div>
                </div>
              <Modal v-model="modalDevice" title="选择该社区使用的设备" width="500" cancel-text="关闭"
                     @on-ok="saveDevice()" @on-cancel="modalDevice = false" ok-text="确定"
                     style="position:relative;">
                <div style="display: table-caption; line-height:25px">
                  <RadioGroup v-model="highMeter1">
                    <Radio label="JieYuDevice">
                      <span>捷宇高拍仪</span>
                    </Radio>
                    <Radio label="LiangTianDevice">
                      <span>良田高拍仪</span>
                    </Radio>
                    <Radio label="ZiTuDevice">
                      <span>紫图高拍仪</span>
                    </Radio>
                    <Radio label="DeYiPaiDevice">
                      <span>德意拍高拍仪</span>
                    </Radio>
                    <Radio label="WeiShanDevice">
                      <span>维山高拍仪</span>
                    </Radio>
                    <Radio label="DianYiPaiDevice">
                      <span>点易拍高拍仪</span>
                    </Radio>
                  </RadioGroup>
                </div>
              </Modal>
            </Menu>
        </Header>
        <Layout>
            <Modal v-model="display_model1_obj.modal1" :title="display_model1_obj.text" width="900">
                <div id="printMe">
                    <Form label-position="right" :label-width="100">
                        <Row>
                            <Col span="24" class="ivu-form-item-content" style="text-align: center">
                                <embed width="800" v-show="display_model1_obj.modal1" height="600"
                                       :src="display_model1_obj.filepath"></embed>
                            </Col>
                        </Row>
                    </Form>
                </div>
                <div slot="footer">
                    <!-- <Button type="success" size="large" v-print="'#printMe'">打印</Button> -->
                    <Button type="error" size="large" @click="display_model1_obj.modal1=false">关闭</Button>
                </div>
            </Modal>
            <Modal v-model="passwordInfo.show" title="修改密码" width="600" :closable="false" :mask-closable="false">
                <Form label-position="right" :label-width="100" ref="passwordInfo" :model="passwordInfo"
                      :rules="ruleInline">
                    <FormItem prop="oldpassword" label="旧密码：" class="set-password-input">
                        <Input type="password" v-model="passwordInfo.oldpassword"></Input>
                    </FormItem>
                    <FormItem prop="newpassword" label="新密码：" class="set-password-input">
                        <Input type="password" v-model="passwordInfo.newpassword"></Input>
                    </FormItem>
                    <FormItem prop="repassword" label="确认密码：" class="set-password-input">
                        <Input type="password" v-model="passwordInfo.repassword"></Input>
                    </FormItem>
                </Form>
                <div slot="footer">
                    <Button type="success" size="large" @click="setPassWord('passwordInfo')">确认</Button>
                    <Button type="error" size="large" @click="closePassWord('passwordInfo')">关闭</Button>
                </div>
            </Modal>
            <Sider hide-trigger  collapsible :width="256" :collapsed-width="64"
                   v-model="collapsed"
                   class="left-sider"
                   :style="{overflow: 'hidden',maxHeight: maxH+'px'}">
                <yiqing-menu :menu-list="minZhengMenus" @on-select="openPage" ref="sideMenu" :active-name="$route.name" :collapsed="collapsed"></yiqing-menu>
                <!-- <three-menu v-if="!reloadItem" :menu-list="treeDataList" @on-select="viewProcess"></three-menu> -->
            </Sider>
<!--            <Sider hide-trigger v-show="!hiddenLeftMenus && !hiddenLeftSystemMenus" collapsible :width="256" :collapsed-width="64"-->
<!--                   v-model="collapsed"-->
<!--                   class="left-sider"-->
<!--                   :style="{overflow: 'hidden',maxHeight: maxH+'px'}">-->
<!--                <yiqing-menu :menu-list="yiQingMenus" @on-select="openPage" ref="sideMenu1" :active-name="$route.name"></yiqing-menu>-->
<!--            </Sider>-->
<!--            <Sider hide-trigger v-show="!hiddenLeftMenus && hiddenLeftSystemMenus" collapsible :width="256" :collapsed-width="64"-->
<!--                   v-model="collapsed"-->
<!--                   class="left-sider"-->
<!--                   :style="{overflow: 'hidden',maxHeight: maxH+'px'}">-->
<!--                <yiqing-menu :menu-list="systemSetUpMenus" @on-select="openPage"></yiqing-menu>-->
<!--            </Sider>-->
            <Layout class="content-layout-v3" :style="{overflow: 'hidden',maxHeight: maxH+'px',overflowY:'scroll'}">
                <!-- <div class="tag-nav-wrapper">
                  <tags-nav :value="$route" @input="handleClick" :list="tagNavList" @on-close="handleCloseTag"/>
                </div> -->
                <Content :style="{padding: '15px', background: '#fff'}">
                    <!-- <keep-alive :include="cacheList">
                      <router-view/>
                    </keep-alive> -->
                    <router-view></router-view>
                </Content>
            </Layout>
        </Layout>
        <Modal
          width="1000px"
          v-model="modalList"
          title="集中隔离转至本社区人员">
            <div style="height: 400px;overflow: auto">
              <Table border :columns="columns" :data="AffirmList">
                <template slot-scope="{ row }" slot="nucleic_acid">
                  <span v-if="row.nucleic_acid == '0'">未检测</span>
                  <span v-if="row.nucleic_acid == '1'">已检测</span>
                </template>
                <template slot-scope="{ row }" slot="isolation">
                  <span v-if="row.isolation == '0'">未隔离</span>
                  <span v-if="row.isolation == '1'">隔离</span>
                </template>
                <template slot-scope="{ row }" slot="detection_1_result">
                  <span v-if="row.detection_1_result == '1'">阴性</span>
                  <span v-if="row.detection_1_result == '2'" style="color: red">阳性</span>
                  <span v-if="row.detection_1_result == '3'">待出结果</span>
                  <span v-if="row.detection_1_result == '4'">未检测</span>
                </template>
                <template slot-scope="{ row }" slot="detection_2_result">
                  <span v-if="row.detection_2_result == '1'">阴性</span>
                  <span v-if="row.detection_2_result == '2'" style="color: red">阳性</span>
                  <span v-if="row.detection_2_result == '3'">待出结果</span>
                  <span v-if="row.detection_2_result == '4'">未检测</span>
                </template>
                <template slot-scope="{ row }" slot="follow_level">
                  <span v-if="row.follow_level == '1'">一级密接</span>
                  <span v-if="row.follow_level == '2'">二级密接</span>
                  <span v-if="row.follow_level == '3'">三级密接</span>
                </template>
                <template slot-scope="{ row }" slot="illness_state">
                  <span v-if="row.illness_state == '1'" style="color: red">疑似病例</span>
                  <span v-if="row.illness_state == '2'" style="color: red">确诊病例</span>
                  <span v-if="row.illness_state == '3'" style="color: red">死亡</span>
                  <span v-if="row.illness_state == '4'" >治愈</span>
                  <span v-if="row.illness_state == '5'" >正常</span>
                </template>
                <template slot-scope="{ row }" slot="inout_state">
                  <span v-if="row.inout_state == '1'">入沈人员</span>
                  <span v-if="row.inout_state == '2'">离沈人员</span>
                </template>
                <template slot-scope="{ row }" slot="paper_card">
                  <span v-if="row.paper_card == '0'">没有</span>
                  <span v-if="row.paper_card == '1'">有</span>
                </template>
                <template slot-scope="{ row }" slot="app_card">
                  <span v-if="row.app_card == '0'">没有</span>
                  <span v-if="row.app_card == '1'">有</span>
                </template>
                <template slot-scope="{ row }" slot="supervise_start">
                  <span v-if="row.supervise_start == '1'">居家隔离</span>
                  <span v-if="row.supervise_start == '2'">询访</span>
                  <span v-if="row.supervise_start == '3'">离沈</span>
                  <span v-if="row.supervise_start == '4'">集中转居家</span>
                  <span v-if="row.supervise_start == '5'">居家转集中</span>
                  <span v-if="row.supervise_start == '6'">解除隔离</span>
                  <span v-if="row.supervise_start == '7'">集中隔离</span>
                </template>
                <template slot-scope="{ row }" slot="referral">
                  <span v-if="row.referral == '1'">已送诊</span>
                  <span v-else style="color: red">未送诊</span>
                </template>
                <template slot-scope="{ row }" slot="state">
                  <span v-if="row.state == '1'">在家留观</span>
                  <span v-if="row.state == '2'">集中留观</span>
                </template>
                <template slot-scope="{ row }" slot="isfollow">
                  <span v-if="row.isfollow == '1'" style="color: red">是</span>
                  <span v-else>否</span>
                </template>
                <template slot-scope="{ row, index }" slot="action">
                  <Button type="error" size="small" style="margin-right: 5px" @click="queren(row)">接收该解除集中隔离人员</Button>
                  <Button type="warning" size="small" style="margin-right: 5px;margin-top:10px" @click="huitui(row)">退回该解除集中隔离人员</Button>
                </template>
              </Table>
              <row>
                <h1 style="color:red;margin-top:30px;text-alogn:center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;为更好的规范集中隔离人员转社区健康监测工作流程，形成工作闭环，集中转社区健康监测人员增加社区确认过程，未确认的请确认。</h1>
              </row>
            </div>
        </Modal>
        <Modal
          width="1000px"
          v-model="BeforehandSendModel"
          title="集中隔离预推送至本社区人员">
            <div style="height: 400px;overflow: auto">
              <Table border :columns="columns3" :data="BeforehandSendApplyList">
                <template slot-scope="{ row }" slot="nucleic_acid">
                  <span v-if="row.nucleic_acid == '0'">未检测</span>
                  <span v-if="row.nucleic_acid == '1'">已检测</span>
                </template>
                <template slot-scope="{ row }" slot="isolation">
                  <span v-if="row.isolation == '0'">未隔离</span>
                  <span v-if="row.isolation == '1'">隔离</span>
                </template>
                <template slot-scope="{ row }" slot="detection_1_result">
                  <span v-if="row.detection_1_result == '1'">阴性</span>
                  <span v-if="row.detection_1_result == '2'" style="color: red">阳性</span>
                  <span v-if="row.detection_1_result == '3'">待出结果</span>
                  <span v-if="row.detection_1_result == '4'">未检测</span>
                </template>
                <template slot-scope="{ row }" slot="detection_2_result">
                  <span v-if="row.detection_2_result == '1'">阴性</span>
                  <span v-if="row.detection_2_result == '2'" style="color: red">阳性</span>
                  <span v-if="row.detection_2_result == '3'">待出结果</span>
                  <span v-if="row.detection_2_result == '4'">未检测</span>
                </template>
                <template slot-scope="{ row }" slot="follow_level">
                  <span v-if="row.follow_level == '1'">一级密接</span>
                  <span v-if="row.follow_level == '2'">二级密接</span>
                  <span v-if="row.follow_level == '3'">三级密接</span>
                </template>
                <template slot-scope="{ row }" slot="illness_state">
                  <span v-if="row.illness_state == '1'" style="color: red">疑似病例</span>
                  <span v-if="row.illness_state == '2'" style="color: red">确诊病例</span>
                  <span v-if="row.illness_state == '3'" style="color: red">死亡</span>
                  <span v-if="row.illness_state == '4'" >治愈</span>
                  <span v-if="row.illness_state == '5'" >正常</span>
                </template>
                <template slot-scope="{ row }" slot="inout_state">
                  <span v-if="row.inout_state == '1'">入沈人员</span>
                  <span v-if="row.inout_state == '2'">离沈人员</span>
                </template>
                <template slot-scope="{ row }" slot="paper_card">
                  <span v-if="row.paper_card == '0'">没有</span>
                  <span v-if="row.paper_card == '1'">有</span>
                </template>
                <template slot-scope="{ row }" slot="app_card">
                  <span v-if="row.app_card == '0'">没有</span>
                  <span v-if="row.app_card == '1'">有</span>
                </template>
                <template slot-scope="{ row }" slot="supervise_start">
                  <span v-if="row.supervise_start == '1'">居家隔离</span>
                  <span v-if="row.supervise_start == '2'">询访</span>
                  <span v-if="row.supervise_start == '3'">离沈</span>
                  <span v-if="row.supervise_start == '4'">集中转居家</span>
                  <span v-if="row.supervise_start == '5'">居家转集中</span>
                  <span v-if="row.supervise_start == '6'">解除隔离</span>
                  <span v-if="row.supervise_start == '7'">集中隔离</span>
                </template>
                <template slot-scope="{ row }" slot="referral">
                  <span v-if="row.referral == '1'">已送诊</span>
                  <span v-else style="color: red">未送诊</span>
                </template>
                <template slot-scope="{ row }" slot="state">
                  <span v-if="row.state == '1'">在家留观</span>
                  <span v-if="row.state == '2'">集中留观</span>
                </template>
                <template slot-scope="{ row }" slot="isfollow">
                  <span v-if="row.isfollow == '1'" style="color: red">是</span>
                  <span v-else>否</span>
                </template>
              </Table>
            </div>
        </Modal>
        <Modal
          width="1000px"
          v-model="modalList1"
          title="集中隔离日期少于5日人员">
            <div style="height: 400px;overflow: auto">
              <Table border :columns="columns2" :data="fiveDayList">
                <template slot-scope="{ row }" slot="nucleic_acid">
              <span v-if="row.nucleic_acid == '0'">未检测</span>
              <span v-if="row.nucleic_acid == '1'">已检测</span>
            </template>
            <template slot-scope="{ row }" slot="isolation">
              <span v-if="row.isolation == '0'">未隔离</span>
              <span v-if="row.isolation == '1'">隔离</span>
            </template>
            <template slot-scope="{ row }" slot="detection_1_result">
            <span v-if="row.detection_1_result == '1'">阴性</span>
            <span v-if="row.detection_1_result == '2'" style="color: red">阳性</span>
            <span v-if="row.detection_1_result == '3'">待出结果</span>
            <span v-if="row.detection_1_result == '4'">未检测</span>
          </template>
          <template slot-scope="{ row }" slot="detection_2_result">
            <span v-if="row.detection_2_result == '1'">阴性</span>
            <span v-if="row.detection_2_result == '2'" style="color: red">阳性</span>
            <span v-if="row.detection_2_result == '3'">待出结果</span>
            <span v-if="row.detection_2_result == '4'">未检测</span>
          </template>
          <template slot-scope="{ row }" slot="follow_level">
            <span v-if="row.follow_level == '1'">一级密接</span>
            <span v-if="row.follow_level == '2'">二级密接</span>
            <span v-if="row.follow_level == '3'">三级密接</span>
          </template>
            <template slot-scope="{ row }" slot="illness_state">
              <span v-if="row.illness_state == '1'" style="color: red">疑似病例</span>
              <span v-if="row.illness_state == '2'" style="color: red">确诊病例</span>
              <span v-if="row.illness_state == '3'" style="color: red">死亡</span>
              <span v-if="row.illness_state == '4'" >治愈</span>
              <span v-if="row.illness_state == '5'" >正常</span>
            </template>
            <template slot-scope="{ row }" slot="inout_state">
              <span v-if="row.inout_state == '1'">入沈人员</span>
              <span v-if="row.inout_state == '2'">离沈人员</span>
            </template>
            <template slot-scope="{ row }" slot="paper_card">
              <span v-if="row.paper_card == '0'">没有</span>
              <span v-if="row.paper_card == '1'">有</span>
            </template>
            <template slot-scope="{ row }" slot="app_card">
              <span v-if="row.app_card == '0'">没有</span>
              <span v-if="row.app_card == '1'">有</span>
            </template>
          <template slot-scope="{ row }" slot="supervise_start">
            <span v-if="row.supervise_start == '1'">居家隔离</span>
            <span v-if="row.supervise_start == '2'">询访</span>
            <span v-if="row.supervise_start == '3'">离沈</span>
            <span v-if="row.supervise_start == '4'">集中转居家</span>
            <span v-if="row.supervise_start == '5'">居家转集中</span>
            <span v-if="row.supervise_start == '7'">集中隔离</span>
          </template>
          <template slot-scope="{ row }" slot="a">
            <div v-if="row.supervise_start == '7'&& row.jzgl_day!=='' && row.jzgl_day!==null &&row.jzgl_day!==undefined">
              <span v-if="parseInt(row.a)>1">正常</span>
              <span v-else style="color: red">预警</span>
            </div>
          </template>
            <template slot-scope="{ row }" slot="referral">
              <span v-if="row.referral == '1'">已送诊</span>
              <span v-else style="color: red">未送诊</span>
            </template>
            <template slot-scope="{ row }" slot="state">
              <span v-if="row.state == '1'">在家留观</span>
              <span v-if="row.state == '2'">集中留观</span>
            </template>
            <template slot-scope="{ row }" slot="isfollow">
              <span v-if="row.isfollow == '1'" style="color: red">是</span>
              <span v-else>否</span>
            </template>
              </Table>
              <!-- <row>
                <h1 style="color:red;margin-top:30px;text-alogn:center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;为更好的规范集中隔离人员转社区健康监测工作流程，形成工作闭环，集中转社区健康监测人员增加社区确认过程，未确认的请确认。</h1>
              </row> -->
            </div>
        </Modal>
        <app-modal ref="appmodal"></app-modal>
    </Layout>
</template>

<script>
import './index.less'
// import logoTime from '@/assets/yiqing/logo_bak.png'
import logoTime from '@/assets/yiqing/yq-back.png'
// import logoTime from '@/assets/images/backImg.png'
import { mapMutations, mapActions, mapGetters } from 'vuex'
import { updatePwd } from '@/api/user'
import { setSeparateNotice, treelist, getCodeUrl } from '@/api/eventlist'
// import ThreeMenu from './three-menu'
// import device from '@/view/demo/device'
import { clearInterval } from 'timers'
import QRCode from 'qrcodejs2'
import { updateUserGPY } from '@/api/common'
import YiqingMenu from '@/view/xian-page/indexv3/yiqing-menu/yiqing-menu'
// import TagsNav from '@/components/main/components/tags-nav'
import { getNewTagList, routeEqual, getMenuByRouter, localSave, localClear } from '@/libs/util'
import { getRouterReq } from '@/api/routers'
import routers from '@/router/routers'
import { mzMenulist } from '@/api/yi-qing-fang-kong'
import Gmk from '@/view/login/Gmk.vue'
import { findAffirmList, updateAffirmTime, relieveIsolation, findOlationList, findBeforehandSendApplyList } from '../../../api/yi-qing-fang-kong'
import AppModal from './components/app-modal'
// import $ from 'jquery'
export default {
  name: 'indexv3',
  components: {
    AppModal,
    YiqingMenu
    // ThreeMenu
  },
  data () {
    const validatePassCheck = (rule, value, callback) => {
      if (value !== this.passwordInfo.newpassword) {
        callback(new Error('确认密码与新密码不相同'))
      } else {
        callback()
      }
    }
    const validatePassCheck1 = (rule, value, callback) => {
      var pwdRegex = new RegExp('(?=.*[0-9]).{8,30}')
      var pwdRegex1 = new RegExp('(?=.*[a-zA-Z]).{8,30}')
      var pwdRegex2 = new RegExp('(?=.*[^a-zA-Z0-9]).{8,30}')
      if (!pwdRegex.test(value)) {
        alert('您的密码复杂度太低（密码中必须包含数字），请及时修改密码！')
      } else if (!pwdRegex1.test(value)) {
        alert('您的密码复杂度太低（密码中必须包含字母），请及时修改密码！')
      } else if (!pwdRegex2.test(value)) {
        alert('您的密码复杂度太低（密码中必须包含特殊字符），请及时修改密码！')
      } else {
        callback()
      }
    }
    return {
      columns: [
        { title: '姓名', key: 'name', width: 100, align: 'center' },
        { title: '联系方式', key: 'tel', width: 120, align: 'center' },
        { title: '身份证号', key: 'cardno', width: 160, align: 'center' },
        { title: '性别', key: 'sex', width: 80, align: 'center' },
        { title: '住所所属区、县(市)', key: 'area', width: 80, align: 'center' },
        { title: '住所所属街道(乡镇)', key: 'street', width: 80, align: 'center' },
        { title: '住所所属社区(村)', key: 'community', width: 100, align: 'center' },
        { title: '具体地址', key: 'address1', minWidth: 250, align: 'center' },
        { title: '当前所属社区', key: 'company_name', width: 100, align: 'center' },
        { title: '录入区防指', key: 'olation_company_name', width: 100, align: 'center' },
        { title: '转社区时间', key: 'olation_out_time', width: 100, align: 'center' },
        { title: '转运联系人', key: 'transfer_name', width: 100, align: 'center' },
        { title: '转运联系人电话', key: 'transfer_tel', width: 100, align: 'center' },
        { title: '转运车辆车牌号', key: 'transfer_id', width: 100, align: 'center' },
        { title: '转运时间', key: 'transfer_time', width: 100, align: 'center' },
        // { title: '核酸检测', slot: 'nucleic_acid', width: 100, align: 'center' },
        // { title: '第一次检测结果', slot: 'detection_1_result', width: 100, align: 'center' },
        // { title: '第二次检测结果', slot: 'detection_2_result', width: 100, align: 'center' },
        // { title: '隔离状态', slot: 'isolation', width: 100, align: 'center' },
        // { title: '人员状态', slot: 'illness_state', width: 100, align: 'center' },
        // { title: '离沈状态', slot: 'inout_state', width: 100, align: 'center' },
        // { title: '管控状态', slot: 'supervise_start', width: 100, align: 'center' },
        // { title: '居家隔离状态', key: 'is_transfer', width: 100, align: 'center' },
        // { title: '发热状态', slot: 'hot', width: 100, align: 'center' },
        // { title: '送诊状态', slot: 'referral', width: 100, align: 'center' },
        // { title: '隔离状态', slot: 'state', width: 100, align: 'center' },
        // { title: '纸质证', slot: 'paper_card', width: 80, align: 'center' },
        // { title: '电子证', slot: 'app_card', width: 80, align: 'center' },
        // { title: '密切接触人群(是/否)', slot: 'isfollow', width: 100, align: 'center' },
        // { title: '密接相关人', key: 'follow_person', width: 100, align: 'center' },
        // { title: '密接等级', slot: 'follow_level', width: 100, align: 'center' },
        // { title: '剩余安全观察期日期', key: 'safe_date', width: 150, align: 'center' },
        { title: '来沈前经过地', key: 'arrive_address_type1', width: 120, align: 'center' },
        { title: '来沈前出发地省', key: 'originate_province', width: 130, align: 'center' },
        { title: '来沈前出发地市', key: 'originate_city', width: 130, align: 'center' },
        { title: '录入时间', key: 'create_time', width: 200, align: 'center' },
        { title: '来沈时间', key: 'arrive_time', width: 200, align: 'center' },
        { title: '操作', align: 'center', width: 200, slot: 'action', fixed: 'right' }
      ],
      AffirmList: [],
      BeforehandSendApplyList: [],
      BeforehandSendModel: false,
      columns3: [
        { title: '姓名', key: 'name', width: 100, align: 'center' },
        { title: '联系方式', key: 'tel', width: 120, align: 'center' },
        { title: '身份证号', key: 'cardno', width: 160, align: 'center' },
        { title: '性别', key: 'sex', width: 80, align: 'center' },
        { title: '住所所属区、县(市)', key: 'area', width: 80, align: 'center' },
        { title: '住所所属街道(乡镇)', key: 'street', width: 80, align: 'center' },
        { title: '住所所属社区(村)', key: 'community', width: 100, align: 'center' },
        { title: '具体地址', key: 'address1', minWidth: 250, align: 'center' },
        { title: '录入区防指', key: 'olation_company_name', width: 100, align: 'center' },
        { title: '来沈前经过地', key: 'arrive_address_type1', width: 120, align: 'center' },
        { title: '来沈前出发地省', key: 'originate_province', width: 130, align: 'center' },
        { title: '来沈前出发地市', key: 'originate_city', width: 130, align: 'center' },
        { title: '录入时间', key: 'create_time', width: 200, align: 'center' },
        { title: '来沈时间', key: 'arrive_time', width: 200, align: 'center' }
      ],
      columns2: [
        { title: '姓名', key: 'NAME', width: 100, align: 'center' },
        { title: '联系方式', key: 'tel', width: 120, align: 'center' },
        { title: '身份证号', key: 'card_no', width: 160, align: 'center' },
        { title: '性别', key: 'sex', width: 80, align: 'center' },
        { title: '管控状态', slot: 'supervise_start', width: 100, align: 'center' },
        { title: '集中隔离开始日期', key: 'olation_time', width: 200, align: 'center' },
        { title: '集中隔离天数', key: 'jzgl_day', width: 200, align: 'center' },
        // { title: '集中隔离剩余天数', key: 'a', width: 200, align: 'center' },
        { title: '预警状态', slot: 'a', width: 200, align: 'center' },
        { title: '来沈前出发地省', key: 'originate_province', width: 130, align: 'center' },
        { title: '来沈前出发地市', key: 'originate_city', width: 130, align: 'center' },
        { title: '区、县(市)', key: 'area', width: 80, align: 'center' },
        { title: '街道(乡镇)', key: 'street', width: 80, align: 'center' },
        { title: '社区(村)', key: 'community', width: 100, align: 'center' },
        { title: '录入时间', key: 'create_time', width: 200, align: 'center' },
        { title: '具体地址', key: 'address1', minWidth: 250, align: 'center' }
      ],
      fiveDayList: [],
      modalList: false,
      modalList1: false,
      modal1: false,
      device_code: '', // 高拍仪参数
      highMeter1: '', // 高拍仪
      highMeter2: '', // 高拍仪
      highMeter3: '', // 高拍仪
      type: '',
      shuju: [],
      codeUrl: '',
      company_codes: '',
      loginCompanyType: '1', // 登录账号类型 1城市 2农村
      loginNames: '',
      modalDevice: false,
      modalDevice1: false,
      modalQr: false,
      timerInterval: null,
      collapsed: false,
      reloadItem: false,
      logoTime,
      totalItemNum: 0,
      totalBMNum: 0,
      treeDataList: [],
      searchName: '',
      personData: {},
      routeList: [],
      passwordInfo: { show: false },
      display_model1_obj: { modal1: false, filepath: '' },
      maxH: `${document.documentElement.clientHeight}` - 166,
      ruleInline: {
        oldpassword: [
          { required: true, message: '请填写旧密码', trigger: 'blur' }
        ],
        newpassword: [
          { required: true, message: '新密码不能为空', trigger: 'blur' },
          { type: 'string', min: 6, message: '密码长度不能少于6位', trigger: 'blur' },
          { validator: validatePassCheck1, trigger: 'blur' }
        ],
        repassword: [
          { required: true, message: '请填写确认密码', trigger: 'blur' },
          { type: 'string', min: 6, message: '密码长度不能少于6位', trigger: 'blur' },
          { validator: validatePassCheck, trigger: 'blur' }
        ]
      },
      yiQingMenus: [],
      minZhengMenus: [],
      login_url: ''
    }
  },
  computed: {
    // menuList () {
    //   return this.treeDataList
    // },
    // hiddenLeftMenus () {
    //   // if (this.$common.xeUtils.arrayIndexOf(['yiQingStreetExportList', 'yiQingSuperiorList', 'yiQingAddInOut', 'yiQingMoveOutList', 'yiQingMoveInList', 'yiQingAreaWarning', 'yiQingList', 'yiQingAdd', 'yiQingStatistics', 'yiQingStatisticsEpidemic', 'yiQingFeverList', 'yiQingAddButtons', 'yiQingEpidemicList', 'yiQingQrCode', 'yiQingFeverNotList', 'yiQingMobileTerminalList', 'yiQingFeverMobileList', 'yiQingSuperiorVillageList', 'yiQingAddApp', 'yiQingShenAppDataList', 'yiQingCityAppDataList', 'yiQingAddCitys', 'yiQingForeignPersonList', 'mainv3'], this.$route.name) !== -1) {
    //   //   return false
    //   // } else {
    //   //   return true
    //   // }
    //   if (this.$common.xeUtils.arrayIndexOf(['mainv3', 'workbench', 'separateservice', 'message', 'item', 'closingratelist', 'grid', 'telnote', 'knowledgebase', 'itemlist', 'handinformation', 'question', 'dailyrecord', 'agentreservation', 'activitymanagement', 'apply_disabled_allowance', 'gridmaintain', 'house_handinformation', 'subsistenceapplication', 'subsistenceapplication1', 'subsistenceapplication2', 'expenditurelist', 'supportlist', 'basicproperty', 'houseproperty', 'workunit', 'educationinfo', 'nearfamily', 'submitinfo', 'stopinsurance', 'deathstop', 'transregionalmigration', 'transferacceptance', 'specialrelief', 'tworescues', 'heatingassistance', 'acceptancenotice', 'matterslist', 'matterssynchronization', 'shequ-jiedao-list', 'tk_subsistenceapplication', 'tk_subsistenceapplication1', 'tk_subsistenceapplication2'], this.$route.name) !== -1) {
    //   //  console.log('1'+true)
    //     return true
    //   } else {
    //     // console.log('1'+false)
    //     return false
    //   }
    // },
    // hiddenLeftSystemMenus () {
    //   if (this.$common.xeUtils.arrayIndexOf(['/systemSetupArea', '/systemSetupUser', '/systemSetupOffice'], this.$route.name) !== -1) {
    //     // console.log('2'+true)
    //     return true
    //   } else {
    //     // console.log('2'+false)
    //     return false
    //   }
    // },
    ...mapGetters([
      'errorCount'
    ]),
    tagNavList () {
      return this.$store.state.app.tagNavList
    },
    tagRouter () {
      return this.$store.state.app.tagRouter
    },
    userAvator () {
      return this.$store.state.user.avatorImgPath
    },
    cacheList () {
      const list = ['ParentView', ...this.tagNavList.length ? this.tagNavList.filter(item => !(item.meta && item.meta.notCache)).map(item => item.name) : []]
      return list
    },
    // menuList () {
    //   return this.$store.getters.menuList
    // },
    local () {
      return this.$store.state.app.local
    },
    hasReadErrorPage () {
      return this.$store.state.app.hasReadErrorPage
    },
    unreadCount () {
      return this.$store.state.user.unreadCount
    }
  },
  methods: {
    ...mapActions([
      'handleLogOut'
    ]),
    appClick () {
      this.$refs.appmodal.init()
    },
    queren (row) {
      updateAffirmTime(row).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '确认成功'
          })
          this.findAffirmList()
        } else {
          this.$Notice.error({
            title: '确认失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    huitui (row) {
      let params = {
        id: row.id,
        supervise_start: '7'
      }
      relieveIsolation(params).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '退回成功'
          })
          this.findAffirmList()
        } else {
          this.$Notice.error({
            title: '退回失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    mzMenulist () {
      let menu_id = 'c4b9a902-a088-11ea-9adb-0242ac110002'
      mzMenulist(menu_id).then(ret => {
        if (ret.data.errcode === 0) {
          this.minZhengMenus = ret.data.data.list
          // this.minZhengMenus.unshift(
          //   { name: '首页',
          //     type_id: 20001,
          //     icon: 'md-home',
          //     path: '/mainv3' }
          // )
        }
      })
    },
    logout () {
      this.handleLogOut().then(() => {
        clearInterval(this.timerInterval)
        localClear()
        // this.token = localStorage.getItem('token')
        // localStorage.setItem('token', this.token)
        if (this.login_url.indexOf('http://qstb') !== -1) {
          window.open('http://qstb.mzj.shenyang.gov.cn/#/login')
        } else { // 生产环境
          this.$router.push({ name: 'login' })
        }
      })
    },
    closePassWord (name) {
      this.passwordInfo.show = false
      this.$refs[name].resetFields()
    },
    setPassWord (name) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          updatePwd(this.passwordInfo).then(res => {
            if (res.data.data) {
              this.$Notice.success({ title: '修改成功', desc: '修改密码后需要重新登录' })
              this.passwordInfo.show = false
              this.logout()
            } else {
              this.$Notice.error({ title: '修改失败', desc: res.data.errmsg })
            }
          })
        } else {
          this.$Notice.error({ title: '信息错误', desc: '密码修改信息错误，请重新填写' })
        }
      })
    },
    findOlationList () {
      findOlationList({ is5day: '1' }).then(res => {
        if (res.data.errcode === 0 || res.data.errcode === 1001) {
          let data = []
          data = res.data.data.results
          console.log('llllllll1', res.data.data)
          if (data.length > 0) {
            console.log('llllllll', data.length)
            this.fiveDayList = res.data.data.results
            this.modalList1 = true
            console.log('llllllll-', this.fiveDayList)
          } else {
            this.modalList1 = false
          }
        } else {
          // this.$Notice.error({
          //   title: '查询列表信息失败',
          //   desc: res.data.errmsg
          // })
        }
      })
    },
    viewProcess (item) {
      if (item.file_url) {
        this.display_model1_obj.text = item.type_name
        this.display_model1_obj.modal1 = true
        this.display_model1_obj.filepath = item.file_url
      } else {
        this.$Notice.error({ title: '无文件', desc: '当前事项无PDF说明文档' })
      }
    },
    openPage (item) {
      if (item.path) {
        this.$router.push({ path: item.path })
      } else if (item.link) {
        window.open(item.link)
      } else {
        this.$Notice.error({ title: '无文件', desc: '等待添加路径' })
      }
    },
    searchList1 () {
      if (!this.searchName) {
        this.searchList()
      }
    },
    searchList () {
      this.reloadItem = true
      this.treeDataList.forEach(e1 => {
        e1.hidden = true
        if (e1.children) {
          let curNum1 = 0
          e1.children.forEach(e2 => {
            if (e2.children) {
              let curNum2 = 0
              e2.children.forEach(e3 => {
                e3.hidden = true
                if (e3.type_name.indexOf(this.searchName) >= 0) {
                  e3.hidden = false
                  curNum2++
                  curNum1++
                }
              })
              e2.hidden = true
              if (curNum2 > 0) {
                e2.count = curNum2
                e2.hidden = false
              }
            } else {
              e2.hidden = true
              if (e2.type_name.indexOf(this.searchName) >= 0) {
                e2.hidden = false
                curNum1++
              }
            }
          })
          if (curNum1 > 0) {
            e1.count = curNum1
            e1.hidden = false
          }
        } else {
          if (!this.searchName) {
            e1.hidden = false
          }
        }
      })
      this.$nextTick(() => {
        this.reloadItem = false
      })
    },
    changeRoute (index) {
      this.routeList.forEach(element => {
        element.state = false
      })
      this.routeList[index].state = true
    },
    getTreeList () {
      treelist().then(ret => {
        let result = ret.data.data
        this.treeDataList = result
        this.treeDataList.forEach(element => {
          element.count = element.count || 0
          if (element.children) {
            this.totalBMNum += 1
            element.children.forEach(e2 => {
              if (e2.children) {
                e2.count = e2.children.length || 0
                element.count += e2.count
              }
            })
            element.count = element.count || element.children.length
          }
          this.totalItemNum += element.count
        })
      })
    },
    showErcode (codeUrl) {
      // let qrcodeEL = document.getElementById('qrcode')
      // let qrcode = new QRCode(qrcodeEL)
      document.getElementById('qrcode').innerHTML = ''
      this.modalQr = true
      this.getCode(codeUrl)
      // qrcode.clear() // clear the code.
      // qrcode.makeCode(codeUrl) // make another code.
    },
    getCode (codeUrl) {
      var qrcode = new QRCode(document.getElementById('qrcode'), {
        text: codeUrl,
        top: 200,
        width: 300,
        height: 300,
        colorDark: '#000000',
        colorLight: '#ffffff',
        correctLevel: QRCode.CorrectLevel.H
      })
      return qrcode
    },
    // 驱动下载
    deviceBinding1 () {
      console.log('设备绑定')
      this.modalDevice1 = true
    },
    // 设备绑定
    deviceBinding () {
      console.log('设备绑定')
      this.modalDevice = true
    },
    saveDevice () {
      updateUserGPY({ device_code: this.highMeter1 }).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '设备绑定成功', desc: '设备绑定成功，请注销重新登录' })
        } else {
          this.$Notice.error({ title: '绑定失败', desc: res.data.errmsg })
        }
      })
      this.$store.state.user.highMeter = this.highMeter1
    },
    findBeforehandSendApplyList () {
      findBeforehandSendApplyList().then(ret => {
        if (ret.data.errcode === 0) {
          let data = []
          data = ret.data.data
          if (data.length > 0) {
            this.BeforehandSendApplyList = ret.data.data
            this.BeforehandSendModel = true
          } else {
            this.BeforehandSendModel = false
          }
        } else {
          this.$Notice.error({ title: '查询失败！', desc: ret.data.errmsg })
        }
      })
    },
    findAffirmList () {
      findAffirmList().then(ret => {
        if (ret.data.errcode === 0) {
          let data = []
          data = ret.data.data
          if (data.length > 0) {
            this.AffirmList = ret.data.data
            this.modalList = true
          } else {
            this.modalList = false
          }
        } else {
          this.$Notice.error({ title: '查询失败！', desc: ret.data.errmsg })
        }
      })
    },
    // // LM总账号显示管理菜单，其他账号不显示
    // permission_display () {
    //   if (this.company_codes !== 'LM') {
    //     let tempList = []
    //     this.routeList.forEach(element => {
    //       if (element.path === '/itemoption' || element.path === '/activitymanagement') {
    //       } else {
    //         tempList.push(element)
    //       }
    //     })
    //     this.routeList = tempList
    //   }
    // },
    // // 不同类型账号菜单过滤
    // loginCode_display () {
    //   console.log(this.loginCompanyType, '账号类型')
    //   if (this.company_codes === 'LM') {
    //     // LM总账号过滤【村统计管理】菜单
    //     this.yiQingMenus.splice(5, 1)
    //     this.yiQingMenus.push(
    //       {
    //         type_name: '集中隔离',
    //         type_id: 20011,
    //         icon: 'ios-create-outline',
    //         children: [
    //           {
    //             type_name: '新增',
    //             path: '/yi-qing/add-jz',
    //             icon: 'ios-add-circle-outline',
    //             type_id: 2001101
    //           }, {
    //             type_name: '列表',
    //             path: '/yi-qing/list-jz',
    //             icon: 'ios-list',
    //             type_id: 2001102
    //           }, {
    //             type_name: '统计分析',
    //             path: '/yi-qing/superior-list',
    //             icon: 'ios-list',
    //             type_id: 2001103
    //           }
    //           // {
    //           //   type_name: '记录',
    //           //   path: '/yi-qing/superior-list-jz',
    //           //   icon: 'ios-list',
    //           //   type_id: 2001104
    //           // }
    //         ] }
    //     )
    //   } else if (this.company_codes === 'LM20927') {
    //     // LM20927为集中安置点账号，只显示[集中安置点]菜单
    //     // let tempList = this.yiQingMenus
    //     // this.yiQingMenus = [tempList[3]]
    //     this.yiQingMenus = []
    //     this.minZhengMenus = []
    //     this.systemSetUpMenus = []
    //   } else if (this.accountList.includes(this.loginNames)) {
    //     this.yiQingMenus = [
    //       {
    //         type_name: '首页',
    //         type_id: 20001,
    //         icon: 'md-home',
    //         path: '/mainv3',
    //         count: 12
    //       }, {
    //         type_name: '集中隔离',
    //         type_id: 20011,
    //         icon: 'ios-create-outline',
    //         children: [
    //           {
    //             type_name: '新增',
    //             path: '/yi-qing/add-jz',
    //             icon: 'ios-add-circle-outline',
    //             type_id: 2001101
    //           }, {
    //             type_name: '列表',
    //             path: '/yi-qing/list-jz',
    //             icon: 'ios-list',
    //             type_id: 2001102
    //           }
    //         ],
    //         count: 12
    //       }]
    //     this.minZhengMenus = [
    //       {
    //         type_name: '首页',
    //         type_id: 30001,
    //         icon: 'md-home',
    //         path: '/mainv3',
    //         count: 12
    //       },
    //       {
    //         type_name: '疫情防控',
    //         type_id: 30012,
    //         icon: 'md-bug',
    //         path: '/yi-qing/statistics',
    //         count: 4
    //       }]
    //   } else if (this.loginNames === 'LM000012' || this.loginNames === 'LM000022' || this.loginNames === 'LM000052' || this.loginNames === 'LM000043' || this.loginNames === 'LM000033' || this.loginNames === 'LM000063' || this.loginNames === 'LM000072' || this.loginNames === 'LM000083' || this.loginNames === 'LM000092' || this.loginNames === 'LM000102' || this.loginNames === 'LM000132' || this.loginNames === 'LM000122' || this.loginNames === 'LM000113') {
    //     this.yiQingMenus = [
    //       {
    //         type_name: '首页',
    //         type_id: 20001,
    //         icon: 'md-home',
    //         path: '/mainv3',
    //         count: 12
    //       }, {
    //         type_name: '集中隔离',
    //         type_id: 20011,
    //         icon: 'ios-create-outline',
    //         children: [
    //           {
    //             type_name: '新增',
    //             path: '/yi-qing/add-jz',
    //             icon: 'ios-add-circle-outline',
    //             type_id: 2001101
    //           }, {
    //             type_name: '列表',
    //             path: '/yi-qing/list-jz',
    //             icon: 'ios-list',
    //             type_id: 2001102
    //           }, {
    //             type_name: '统计分析',
    //             path: '/yi-qing/superior-list',
    //             icon: 'ios-list',
    //             type_id: 2001103
    //           }
    //         ],
    //         count: 12
    //       }]
    //     this.minZhengMenus = [
    //       {
    //         type_name: '首页',
    //         type_id: 30001,
    //         icon: 'md-home',
    //         path: '/mainv3',
    //         count: 12
    //       },
    //       {
    //         type_name: '疫情防控',
    //         type_id: 30012,
    //         icon: 'md-bug',
    //         path: '/yi-qing/statistics',
    //         count: 4
    //       }]
    //   } else if (this.loginNames === 'LM40001' || this.loginNames === 'LM400011') {
    //     this.yiQingMenus = [
    //       {
    //         type_name: '首页',
    //         type_id: 20001,
    //         icon: 'md-home',
    //         path: '/mainv3',
    //         count: 12
    //       }, {
    //         type_name: '疫情人员',
    //         type_id: 20011,
    //         icon: 'ios-create-outline',
    //         children: [
    //           {
    //             type_name: '列表',
    //             path: '/yi-qing/list-wj',
    //             icon: 'ios-list',
    //             type_id: 2001102
    //           }
    //         ],
    //         count: 12
    //       }]
    //     this.minZhengMenus = [
    //       {
    //         type_name: '首页',
    //         type_id: 30001,
    //         icon: 'md-home',
    //         path: '/mainv3',
    //         count: 12
    //       },
    //       {
    //         type_name: '疫情防控',
    //         type_id: 30012,
    //         icon: 'md-bug',
    //         path: '/yi-qing/statistics',
    //         count: 4
    //       }]
    //   } else if (this.loginNames === 'LM40002') {
    //     this.minZhengMenus =
    //       [
    //         {
    //           type_name: '首页',
    //           type_id: 30001,
    //           icon: 'md-home',
    //           path: '/mainv3',
    //           count: 12
    //         },
    //         {
    //           type_name: '客服功能',
    //           type_id: 20011,
    //           icon: 'ios-create-outline',
    //           children: [
    //             {
    //               type_name: '疫情人员信息管理',
    //               path: '/kefupage/edit',
    //               icon: 'md-cafe',
    //               type_id: 2001101
    //             },
    //             {
    //               type_name: '账号重置',
    //               path: '/kefupage/reset-account',
    //               icon: 'md-refresh',
    //               type_id: 2001101
    //             }
    //           ]
    //         }
    //       ]
    //     this.yiQingMenus = this.minZhengMenus
    //   } else if ((this.loginNames === 'LM000011' || this.loginNames === 'LM000021' || this.loginNames === 'LM000031' || this.loginNames === 'LM000042' || this.loginNames === 'LM000051' || this.loginNames === 'LM000062' || this.loginNames === 'LM000071' || this.loginNames === 'LM000082' || this.loginNames === 'LM000091' || this.loginNames === 'LM000101' || this.loginNames === 'LM000111' || this.loginNames === 'LM000121' || this.loginNames === 'LM000131') && this.loginCompanyType === '1') {
    //     // 村管理账号只保留【村排查】和【村统计列表】两个菜单
    //     // this.yiQingMenus.splice(0, 1)
    //     // this.yiQingMenus.splice(2, 1)
    //     // this.yiQingMenus.splice(3, 1)
    //     // this.yiQingMenus.splice(4, 1)
    //     // this.yiQingMenus.splice(5, 1)
    //     // this.yiQingMenus.splice(6, 1)
    //     // this.yiQingMenus.splice(7, 1)
    //     let tempList = this.yiQingMenus
    //     this.yiQingMenus = [tempList[0], tempList[2], tempList[5]]
    //     this.minZhengMenus.splice(5, 1)
    //     console.log(this.yiQingMenus, '123123')
    //   } else if (this.loginCompanyType === '2') {
    //     // 农村账号，在菜单中删除[社区排查][集中安置点][移动端管理]菜单
    //     // this.yiQingMenus.splice(0, 1)
    //     // this.yiQingMenus.splice(1, 1)
    //     // this.yiQingMenus.splice(4, 1)
    //     this.yiQingMenus.splice(5, 3)
    //     this.minZhengMenus.splice(5, 1)
    //   } else if (this.loginCompanyType === '1' && this.loginNames !== 'LM000011' && this.loginNames !== 'LM000021' && this.loginNames !== 'LM000031' && this.loginNames !== 'LM000042' && this.loginNames !== 'LM000051' && this.loginNames !== 'LM000062' && this.loginNames !== 'LM000071' && this.loginNames !== 'LM000082' && this.loginNames !== 'LM000091' && this.loginNames !== 'LM000101' && this.loginNames !== 'LM000111' && this.loginNames !== 'LM000121' && this.loginNames !== 'LM000131') {
    //     // console.log(this.company_codes, 'fdsfadsfa')
    //     // 城市账号，在菜单中删除[村排查][集中安置点][移动端管理]菜单
    //     // this.yiQingMenus.splice(1, 2)
    //     // this.yiQingMenus.splice(4, 1)
    //     this.yiQingMenus.splice(5, 3)
    //     this.minZhengMenus.splice(5, 1)
    //   }
    // },
    setFlowSee (id) {
      setSeparateNotice(id).then(res => {
      })
    },
    toSeparate () {
      let router = this.$store.state.app.mainv3Nav
      router.forEach(element => {
        element.state = false
      })
      router[2].state = true
      this.$router.push({
        name: 'separateservice',
        params: { tabindex: 1 }
      })
    },
    ...mapMutations([
      'setBreadCrumb',
      'setTagNavList',
      'addTag',
      'setLocal',
      'setFirstMenuId',
      'setHomeRoute',
      'closeTag'
    ]),
    ...mapActions([
      'handleLogin',
      'getUnreadMessageCount',
      'getAjaxRouterData'
    ]),
    turnToPage (route) {
      console.log(route, 'main/turnToPage')
      let { name, params, query } = {}
      if (typeof route === 'string') name = route
      else {
        name = route.name
        params = route.params
        query = route.query
      }
      if (name.indexOf('isTurnByHref_') > -1) {
        window.open(name.split('_')[1])
        return
      }
      this.$router.push({
        name,
        params,
        query
      })
    },
    handleCollapsedChange (state) {
      this.collapsed = state
    },
    handleCloseTag (res, type, route) {
      if (type !== 'others') {
        if (type === 'all') {
          this.turnToPage(this.$config.homeName)
        } else {
          if (routeEqual(this.$route, route)) {
            this.closeTag(route)
          }
        }
      }
      this.setTagNavList(res)
    },
    handleClick (item) {
      console.log(item, '执行main/handleClick')
      this.turnToPage(item)
    },
    getRouterListData () {
      getRouterReq('222').then(res => {
        console.log('打印返回的信息', res.data)
        let listData = getMenuByRouter(res.data, 'admin')
        console.log('返回的结果')
        console.log(listData)
        this.menuList001 = listData
      })
    },
    groupMenuSelect (id, menusData) {
      // this.setFirstMenuId(id)
      localSave('first-menus-data', JSON.stringify(menusData))
      this.$store.dispatch('getAjaxRouterData', id)
    },
    cheakPassword () {
      // console.log('Gmk.password:' + Gmk.password)
      var value = Gmk.password
      if (!value) {
        return
      }
      var pwdRegex = new RegExp('(?=.*[0-9]).{8,30}')
      var pwdRegex1 = new RegExp('(?=.*[a-zA-Z]).{8,30}')
      var pwdRegex2 = new RegExp('(?=.*[^a-zA-Z0-9]).{8,30}')
      if (!pwdRegex.test(value)) {
        this.$Notice.error({ title: '您的密码复杂度太低（密码中必须包含数字），请及时修改密码！' })
        this.passwordInfo.show = true
      } else if (!pwdRegex1.test(value)) {
        this.$Notice.error({ title: '您的密码复杂度太低（密码中必须包含字母），请及时修改密码！' })
        // alert('您的密码复杂度太低（密码中必须包含字母），请及时修改密码！')
        this.passwordInfo.show = true
      } else if (!pwdRegex2.test(value)) {
        this.$Notice.error({ title: '您的密码复杂度太低（密码中必须包含特殊字符），请及时修改密码！' })
        this.passwordInfo.show = true
      }
      Gmk.password = ''
    },
    showQrCode () {
      this.modal1 = true
      this.$refs.qrCode.innerHTML = ''
      let qrcode = new QRCode('qrCode', {
        width: 200,
        height: 200, // 高度
        text: 'https://shengst.tripln.top/subsidy/#/city-card-fi-staff-registration-community?company_code=' + this.$store.state.user.severUserInfo.company_code,
        render: 'canvas', // 设置渲染方式（有两种方式 table和canvas，默认是canvas）
        colorDark: '#000000', // 二维码颜色
        colorLight: '#ffffff' // 二维码背景色
      })
      console.log('-二维码-', qrcode)
    }
  },
  watch: {
    '$route' (newRoute) {
      console.log(newRoute, 'watch新的路由变化')
      // console.log(this.menuList, '获取当菜单数据')
      let tempMenuList = this.menuList
      for (let key in tempMenuList) {
        let childData = tempMenuList[key].children
        if (tempMenuList[key].name && tempMenuList[key].name === newRoute.name) {
          // console.log('ok11')
          newRoute.meta.title = tempMenuList[key].meta.title // 为了不在路由里面取名字写的循环
        } else {
          if (tempMenuList[key].children && tempMenuList[key].children.length > 0) {
            for (let k2 in childData) {
              let chid = childData[k2]
              if (chid.name === newRoute.name) {
                // console.log('ok')
                newRoute.meta.title = chid.meta.title // 为了不在路由里面取名字写的循环
              }
            }
          }
        }
      }
      const { name, query, params, meta } = newRoute
      if (newRoute.meta.hide !== false) {
        this.addTag({
          route: { name, query, params, meta },
          type: 'push'
        })
        this.setBreadCrumb(newRoute)
        this.setTagNavList(getNewTagList(this.tagNavList, newRoute))
      }
      // this.$refs.sideMenu.updateOpenName(newRoute.name)
    }
  },
  mounted () {
    this.login_url = this.login_url = window.location.href
    this.mzMenulist()
    this.setTagNavList()
    this.setHomeRoute(routers)
    const { name, params, query, meta } = this.$route
    this.addTag({
      route: { name, params, query, meta }
    })
    let severUserInfo = this.$store.state.user.severUserInfo
    this.loginCompanyType = severUserInfo.company_type
    this.device_code = severUserInfo.email
    this.company_codes = severUserInfo.company_code
    this.loginNames = severUserInfo.loginName
    this.personData.name = severUserInfo.name
    this.personData.company_name = severUserInfo.company_name
    getCodeUrl(this.company_codes, this.loginNames).then(res => {
      this.codeUrl = res.data.result.url
    })
    this.routeList = this.$store.state.app.mainv3Nav
    // this.getTreeList()
    this.cheakPassword()
    this.findAffirmList()
    this.findBeforehandSendApplyList()
    this.findOlationList()
    // 管理账号和非管理账号的菜单过滤
    // this.permission_display()
    // 城市账号|农村账号|集中安置点账号 菜单过滤
    // this.loginCode_display()

    // this.timerInterval = setInterval(() => {
    //   getSeparateNotice().then(res => {
    //     res.data.data.forEach(element => {
    //       this.$Notice.close(element.id)
    //       this.$Notice.info({
    //         title: '您有新的收受分离事项！',
    //         duration: 0,
    //         name: element.id,
    //         render: h => {
    //           return h('span', [
    //             element.title,
    //             h('Button', {
    //               props: { type: 'primary', size: 'small' },
    //               style: { marginLeft: '10px' },
    //               on: {
    //                 click: () => {
    //                   this.setFlowSee(element.id)
    //                   this.toSeparate()
    //                   this.$Notice.close(element.id)
    //                 }
    //               }
    //             }, '查看')
    //           ])
    //         },
    //         onClose: () => {
    //           this.setFlowSee(element.id)
    //         }
    //       })
    //     })
    //   })
    //   // 页面获取收受分离信息30秒调一次
    // }, 30000)
  }
}
</script>
